const commonData = {
  state:{
    lastViews:[],
    collectViews:0,   
    screenWidth:document.documentElement.clientWidth, //屏幕宽度
    screenHeight:document.documentElement.clientHeight, //屏幕高度
		serverUrl:"",
		noRequest:0,
		curMsg:null,
  },
  mutations:{
    refreshLast(state,data){
      state.lastViews = data;
    },
    refreshCollect(state,data){
      state.collectViews = state.collectViews + data;
    },    
    refreshScreenWidth:function (state,data) {
      state.screenWidth = data;
    },
    refreshScreenHeight:function (state,data) {
      state.screenHeight = data;
    },
    refreshServerUrl:function (state,data) {
      state.serverUrl = data;
    },
    refreshNoRequest:function (state,data) {
      state.noRequest = data;
    },
    refreshCurMsg:function (state,data) {
      state.curMsg = data;
    }
  },
  actions:{
    refreshLast:function ({commit},data) {
      commit("refreshLast",data);
    },
    refreshCollect:function ({commit},data) {
      commit("refreshCollect",data);
    },    
    refreshScreenWidth:function ({commit},data) {
      commit("refreshScreenWidth",data);
    },
    refreshScreenHeight:function ({commit},data) {
      commit("refreshScreenHeight",data);
    },
    refreshServerUrl:function ({commit},data) {
      commit("refreshServerUrl",data);
    },
    refreshNoRequest:function ({commit},data) {
      commit("refreshNoRequest",data);
    },
    refreshCurMsg:function ({commit},data) {
      commit("refreshCurMsg",data);
    },    
  }
}

export default commonData;
